package com.board.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

import com.board.db.sqlconfig.IBatisDBConnector;
import com.ibatis.sqlmap.client.SqlMapClient;

public class CommonDao {
	
	/*
	private final String driverName = "com.mysql.jdbc.Driver";
	private final String url = "jdbc:mysql://localhost:3306/BOARD";
	private final String db_id = "root";
	private final String db_pwd = "kdj1208";
	
	private Connection conn = null;
	private Statement stmt = null;
	
	
	public Statement openConnection() {
		try {
			Class.forName(driverName);
			conn = DriverManager.getConnection(url,db_id,db_pwd);
			stmt = conn.createStatement();
		} catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
		
		return stmt;
	}
	
	public void closeConnection() {
		try {
			if (!conn.isClosed()) {
				conn.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	*/
	
	private SqlMapClient myDB;

	public SqlMapClient GetDB() {
		return myDB;
	}

	public void SetDB() {
		myDB = IBatisDBConnector.getSqlMapInstance();
	}
	
	
	
	
}
